//
//  MyTXController.m
//  PosApp
//
//  Created by 刘萍 on 2018/9/13.
//  Copyright © 2018年 李英新. All rights reserved.
//

#import "MyTXController.h"
#import "TXViewController.h"

@interface MyTXController ()
@property (weak, nonatomic) IBOutlet UILabel *AllPriceLabel;

@end

@implementation MyTXController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    self.navigationItem.title = @"可提现余额";
    self.AllPriceLabel.text = @"0.00";
    
    
    NSMutableDictionary * dic = [[NSMutableDictionary alloc] init];
    [dic setObject:KUseriPhone forKey:@"phone"];
    
    [MainObjectWay PostWithMethod:@"draw" andAction:@"User" andAddParam:YES parameters:dic success:^(id responseObject) {
        NSLog(@"返回的信息 = %@",responseObject);
        if ([MainObjectWay IsSucceedWithCode:responseObject[@"code"]]) {
            self.AllPriceLabel.text = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"blance"]];
        }
    } failure:^(NSError *error) {
        NSLog(@"错误信息 = %@",error);
    }];
    
    
}
- (IBAction)ClickOnBtnToTXController:(id)sender {
    TXViewController * TXC = [[TXViewController alloc] init];
    TXC.AllPrice = [NSString stringWithFormat:@"%@",self.AllPriceLabel.text];
    [self.navigationController pushViewController:TXC animated:YES];
    if ([self.AllPriceLabel.text floatValue] > 0) {
        
    }else{
        [MBProgressHUD showAlertViewWithText:@"余额不足"];
    }
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
